package com.yuxi.juanzi.topic1;

public class Vehicle {
    private int speed;
    private int size;

    public Vehicle(int speed, int size) {
        this.speed = speed;
        this.size = size;
    }

    public Vehicle() {
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public void move(){
        System.out.println("一辆时速为"+speed+"km/h体积为"+size+
                "立方的车正在移动");
    }
    public void speedUp(){
        speed++;
    }
    public void speedDown(){
        speed--;
    }



    @Override
    public String toString() {
        return "Vehicle{" +
                "speed=" + speed +
                ", size=" + size +
                '}';
    }
}
